﻿Imports System.Collections.Specialized
Public Class FindFormEnglish
    Public Overrides Sub Find()
        MyBase.Find()
        FindTextEventForm(Me.txtFindText.Text, 0)
    End Sub

    Private Sub txtFindText_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtFindText.TextChanged
        If chkInant.Checked Then
            Find()
        End If
    End Sub

    Private Sub radChinese_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles radChinese.CheckedChanged
        txtFindText.ImeMode = Windows.Forms.ImeMode.On
        If radChinese.Checked Then
            GroupBox2.Enabled = True
            GroupBox3.Enabled = False
            GroupBox5.Enabled = False
        End If
    End Sub

    Private Sub radEnglish_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles radEnglish.CheckedChanged
        txtFindText.ImeMode = Windows.Forms.ImeMode.Off
        If radEnglish.Checked Then
            GroupBox2.Enabled = True
            GroupBox5.Enabled = False
            GroupBox3.Enabled = False
        End If
    End Sub

    Private Sub chk备注_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles chk备注.CheckedChanged
        If chk备注.Checked Then
            GroupBox2.Enabled = False
            GroupBox5.Enabled = False
            GroupBox3.Enabled = True
        End If
    End Sub

    Private Sub rad打印记录_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles rad打印记录.CheckedChanged
        If rad打印记录.Checked Then
            GroupBox2.Enabled = False
            GroupBox5.Enabled = True
            GroupBox3.Enabled = False
        End If
    End Sub

    Public Overrides ReadOnly Property FirstControl() As System.Windows.Forms.Control
        Get
            Return txtFindText
        End Get
    End Property

    Public 当前英语备注ID As Int32 = 0
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Using frm As Wys.Control.Vb.ListForm = New Wys.Control.Vb.ListForm
            frm.strName = Me.strName
            frm.iType = Me.iType
            frm.SQL = "select * from MEMO where type=1"
            Dim 显示列 As New StringCollection
            显示列.Add("TITLE")
            frm.显示列 = 显示列
            frm.ShowDialog()
            If frm.返回值.Count > 0 Then
                当前英语备注ID = CInt(frm.返回值(0))
                txt备注.Text = CStr(frm.返回值(1))
                If chkInant.Checked Then
                    Find()
                End If
            End If
        End Using
    End Sub

    
    Private Sub FindFormEnglish_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Dim rs As ADODB.Recordset
        Dim strSql As String = "select * from printLog where [type]=0 order by datetime desc"
        rs = ct.GetTable(strSql)
        If rs IsNot Nothing Then
            While Not rs.EOF
                cbo报表打印时间.Items.Add(rs.Fields("datetime").Value.ToString())
                rs.MoveNext()
            End While
            rs.Close()
            System.Runtime.InteropServices.Marshal.ReleaseComObject(rs)
            rs = Nothing
        End If
        If Me.cbo报表打印时间.Items.Count > 0 Then
            Me.cbo报表打印时间.SelectedIndex = 0
        End If
    End Sub
End Class
